package com.cda.mall.controller;


import com.cda.mall.service.IUserAddrService;
import com.cda.mall.vo.ResultVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 用户地址  前端控制器
 * </p>
 *
 * @author cda
 * @since 2021-11-13
 */
@RestController
@RequestMapping("/useraddr")
@Api(value = "提供收货地址相关接口",tags = "收货地址管理")
public class UserAddrController {

    @Autowired
    private IUserAddrService userAddrService;

    @GetMapping("/list")
    @ApiImplicitParam(dataType = "Integer",name = "userId",value = "用户id",required = true)
    public ResultVO listAddr(Integer userId,@RequestHeader("token")String token){
        ResultVO resultVO = userAddrService.listAddrsByUid(userId);
        return resultVO;
    }
}

